An Investigation of the Laws of Traversals
نویسندگان
چکیده
Traversals of data structures are ubiquitous in programming. Consequently, it is important to be able to characterise those structures that are traversable and understand their algebraic properties. Traversable functors have been characterised by McBride and Paterson as those equipped with a distributive law over arbitrary applicative functors; however, laws that fully capture the intuition behind traversals are missing. This article is an attempt to remedy this situation by proposing laws for characterising traversals that capture the intuition behind them. To support our claims, we prove that finitary containers are traversable in our sense and argue that elements in a traversable structure are visited exactly once.
منابع مشابه
An improved algorithm to reconstruct a binary tree from its inorder and postorder traversals
It is well-known that, given inorder traversal along with one of the preorder or postorder traversals of a binary tree, the tree can be determined uniquely. Several algorithms have been proposed to reconstruct a binary tree from its inorder and preorder traversals. There is one study to reconstruct a binary tree from its inorder and postorder traversals, and this algorithm takes running time of...
متن کاملAn improved algorithm to reconstruct a binary tree from its inorder and postorder traversals
It is well-known that, given inorder traversal along with one of the preorder or postorder traversals of a binary tree, the tree can be determined uniquely. Several algorithms have been proposed to reconstruct a binary tree from its inorder and preorder traversals. There is one study to reconstruct a binary tree from its inorder and postorder traversals, and this algorithm takes running time of...
متن کاملA novel algorithm to determine the leaf (leaves) of a binary tree from its preorder and postorder traversals
Binary trees are essential structures in Computer Science. The leaf (leaves) of a binary tree is one of the most significant aspects of it. In this study, we prove that the order of a leaf (leaves) of a binary tree is the same in the main tree traversals; preorder, inorder, and postorder. Then, we prove that given the preorder and postorder traversals of a binary tree, the leaf (leaves) of a bi...
متن کاملA Numerical Investigation on the Unstable Flow in a Single Stage of an Axial Compressor
An unsteady two-dimensional finite-volume solver was developed based on Van Leer’s flux splitting algorithm in conjunction with “Monotonic Upstream Scheme for Conservation Laws (MUSCL)” limiters to improve the order of accuracy and the two-layer Baldwin-Lomax turbulence model was also implemented. Two test cases were prepared to validate the solver. The computed results were compared with the e...
متن کاملInvestigation of Bakhtiari Carpet Designs based on Kaplan-Gestalt Model
Carpet is one of the most important textiles man-made. The rug represents the aspirations and interests of the people who weave it. Therefore, recognizing the image in carpets can be a window into recognizing these ideals. In this research, Bakhtiari rug is investigated. Bakhtiari rugs (toranji, yalameh and cetral) are textiles produced by Bakhtiari people of choharmahal-o-bakhtiari province. T...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2012